package com.sxx.beautifulcity.activity;

import android.Manifest;
import android.annotation.TargetApi;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.sxx.beautifulcity.R;
import com.sxx.beautifulcity.toast.commcommonToast;

/**
 * Created by dllo on 15/11/6.
 *
 */
public class JudgeActivity extends AppCompatActivity implements View.OnClickListener {
    private TextView title, moreTv;
    private Button buttonsubmit;
    private ImageView backIv;
    private EditText judge_text;
    private String judgeText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_judge);
        initView();
    }

    /***
     * 初始化
     */
    private void initView() {

        title = (TextView) findViewById(R.id.titleTv);
        backIv = (ImageView) findViewById(R.id.backIV);
        buttonsubmit = (Button) findViewById(R.id.buttonsubmit);
        title.setText("评论");
        moreTv = (TextView) findViewById(R.id.moreTv);
        moreTv.setText("");
        backIv.setOnClickListener(this);
        buttonsubmit.setOnClickListener(this);
        judge_text = (EditText) findViewById(R.id.judge_text);
        judgeText = judge_text.getText().toString();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.backIV:
                Intent intent = new Intent();
                intent.setClass(this, MainActivity.class);
                startActivity(intent);
                finish();
                overridePendingTransition(R.anim.left_out, R.anim.right_into);
                break;
            case R.id.buttonsubmit:
                if (judgeText != null && judgeText.length() > 0) {
                    Intent intent1 = new Intent();
                    intent1.setClass(this, MainActivity.class);
                    startActivity(intent1);
                    finish();
                    overridePendingTransition(R.anim.left_out, R.anim.right_into);
                    commcommonToast.submitToast();
                }
                break;
        }
    }
}
